package cn.tedu.pro.comtroller;

import cn.HK.po.Order;
import cn.HK.vo.SystemResult;
import cn.tedu.pro.service.proService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class comtroller {
    @Autowired
    private proService proService;

    /*
    请求地址 /order/preOrder
    请求参数    Order
    返回类型 SystemResult

     */

    @RequestMapping("/order/preOrder")
    public SystemResult add(Order order) {
        try {
            System.out.println(order.getoStart());
            proService.add(order);
            return SystemResult.ok();

        } catch (Exception e) {
            e.printStackTrace();
            return SystemResult.build(201,"预约失败",null);

        }


    }
}


